package com.example.android.bluetoothchat;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.example.android.common.activities.SampleActivityBase;

/**
 * Created by Administrator on 2017/4/23 0023.
 *
 * 程序主界面
 */

public class MainActivity extends SampleActivityBase {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        // 点击进入客户端页面
        findViewById(R.id.btn_client).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ClientActivity.go(MainActivity.this);
            }
        });

        // 点击计入管理员页面
        findViewById(R.id.btn_server).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ServerActivity.go(MainActivity.this);
            }
        });
    }

    public static void go(Context context){
        Intent intent = new Intent(context ,MainActivity.class);
        context.startActivity(intent);
    }

}
